2000W / 48V LLC Battery-Charger  V1.00

Event Request Unit (ERU) driver for the XMC microcontroller family. More...

Collaboration diagram for ERU:

Classes

struct  XMC_ERU_t
 
struct  XMC_ERU_ETL_CONFIG
 
union  XMC_ERU_OGU_CONFIG
 

Typedefs

typedef enum XMC_ERU_ETL_INPUT_A XMC_ERU_ETL_INPUT_A_t
 
typedef enum XMC_ERU_ETL_INPUT_B XMC_ERU_ETL_INPUT_B_t
 
typedef enum XMC_ERU_ETL_SOURCE XMC_ERU_ETL_SOURCE_t
 
typedef enum XMC_ERU_ETL_EDGE_DETECTION XMC_ERU_ETL_EDGE_DETECTION_t
 
typedef enum XMC_ERU_ETL_OUTPUT_TRIGGER_CHANNEL XMC_ERU_ETL_OUTPUT_TRIGGER_CHANNEL_t
 
typedef enum XMC_ERU_ETL_OUTPUT_TRIGGER XMC_ERU_ETL_OUTPUT_TRIGGER_t
 
typedef enum XMC_ERU_ETL_STATUS_FLAG_MODE XMC_ERU_ETL_STATUS_FLAG_MODE_t
 
typedef enum XMC_ERU_OGU_PATTERN_DETECTION XMC_ERU_OGU_PATTERN_DETECTION_t
 
typedef enum XMC_ERU_OGU_PATTERN_DETECTION_INPUT XMC_ERU_OGU_PATTERN_DETECTION_INPUT_t
 
typedef enum XMC_ERU_OGU_PERIPHERAL_TRIGGER XMC_ERU_OGU_PERIPHERAL_TRIGGER_t
 
typedef enum XMC_ERU_OGU_SERVICE_REQUEST XMC_ERU_OGU_SERVICE_REQUEST_t
 
typedef struct XMC_ERU_ETL_CONFIG XMC_ERU_ETL_CONFIG_t
 
typedef union XMC_ERU_OGU_CONFIG XMC_ERU_OGU_CONFIG_t
 

Enumerations

enum  XMC_ERU_ETL_INPUT_A { XMC_ERU_ETL_INPUT_A0 = 0x0U, XMC_ERU_ETL_INPUT_A1 = 0x1U, XMC_ERU_ETL_INPUT_A2 = 0x2U, XMC_ERU_ETL_INPUT_A3 = 0x3U }
 
enum  XMC_ERU_ETL_INPUT_B { XMC_ERU_ETL_INPUT_B0 = 0x0U, XMC_ERU_ETL_INPUT_B1 = 0x1U, XMC_ERU_ETL_INPUT_B2 = 0x2U, XMC_ERU_ETL_INPUT_B3 = 0x3U }
 
enum  XMC_ERU_ETL_SOURCE {
  XMC_ERU_ETL_SOURCE_A = 0x0U, XMC_ERU_ETL_SOURCE_B = 0x1U, XMC_ERU_ETL_SOURCE_A_OR_B = 0x2U, XMC_ERU_ETL_SOURCE_A_AND_B = 0x3U,
  XMC_ERU_ETL_SOURCE_NOT_A = 0x4U, XMC_ERU_ETL_SOURCE_NOT_A_OR_B = 0x6U, XMC_ERU_ETL_SOURCE_NOT_A_AND_B = 0x7U, XMC_ERU_ETL_SOURCE_NOT_B = 0x9U,
  XMC_ERU_ETL_SOURCE_A_OR_NOT_B = 0xaU, XMC_ERU_ETL_SOURCE_A_AND_NOT_B = 0xbU, XMC_ERU_ETL_SOURCE_NOT_A_OR_NOT_B = 0xeU, XMC_ERU_ETL_SOURCE_NOT_A_AND_NOT_B = 0xfU
}
 
enum  XMC_ERU_ETL_EDGE_DETECTION { XMC_ERU_ETL_EDGE_DETECTION_DISABLED = 0U, XMC_ERU_ETL_EDGE_DETECTION_RISING = 1U, XMC_ERU_ETL_EDGE_DETECTION_FALLING = 2U, XMC_ERU_ETL_EDGE_DETECTION_BOTH = 3U }
 
enum  XMC_ERU_ETL_OUTPUT_TRIGGER_CHANNEL { XMC_ERU_ETL_OUTPUT_TRIGGER_CHANNEL0 = 0U, XMC_ERU_ETL_OUTPUT_TRIGGER_CHANNEL1 = 1U, XMC_ERU_ETL_OUTPUT_TRIGGER_CHANNEL2 = 2U, XMC_ERU_ETL_OUTPUT_TRIGGER_CHANNEL3 = 3U }
 
enum  XMC_ERU_ETL_OUTPUT_TRIGGER { XMC_ERU_ETL_OUTPUT_TRIGGER_DISABLED = 0U, XMC_ERU_ETL_OUTPUT_TRIGGER_ENABLED = 1U }
 
enum  XMC_ERU_ETL_STATUS_FLAG_MODE { XMC_ERU_ETL_STATUS_FLAG_MODE_SWCTRL = 0U, XMC_ERU_ETL_STATUS_FLAG_MODE_HWCTRL = 1U }
 
enum  XMC_ERU_OGU_PATTERN_DETECTION { XMC_ERU_OGU_PATTERN_DETECTION_DISABLED = 0U, XMC_ERU_OGU_PATTERN_DETECTION_ENABLED = 1U }
 
enum  XMC_ERU_OGU_PATTERN_DETECTION_INPUT { XMC_ERU_OGU_PATTERN_DETECTION_INPUT0 = 1U, XMC_ERU_OGU_PATTERN_DETECTION_INPUT1 = 2U, XMC_ERU_OGU_PATTERN_DETECTION_INPUT2 = 4U, XMC_ERU_OGU_PATTERN_DETECTION_INPUT3 = 8U }
 
enum  XMC_ERU_OGU_PERIPHERAL_TRIGGER { XMC_ERU_OGU_PERIPHERAL_TRIGGER1 = 1U, XMC_ERU_OGU_PERIPHERAL_TRIGGER2 = 2U, XMC_ERU_OGU_PERIPHERAL_TRIGGER3 = 3U }
 
enum  XMC_ERU_OGU_SERVICE_REQUEST { XMC_ERU_OGU_SERVICE_REQUEST_DISABLED = 0U, XMC_ERU_OGU_SERVICE_REQUEST_ON_TRIGGER = 1U, XMC_ERU_OGU_SERVICE_REQUEST_ON_TRIGGER_AND_PATTERN_MATCH = 2U, XMC_ERU_OGU_SERVICE_REQUEST_ON_TRIGGER_AND_PATTERN_MISMATCH = 3U }
 

Functions

void XMC_ERU_Enable (XMC_ERU_t *const eru)
 
void XMC_ERU_Disable (XMC_ERU_t *const eru)
 
void XMC_ERU_ETL_Init (XMC_ERU_t *const eru, const uint8_t channel, const XMC_ERU_ETL_CONFIG_t *const config)
 
void XMC_ERU_ETL_SetInput (XMC_ERU_t *const eru, const uint8_t channel, const XMC_ERU_ETL_INPUT_A_t input_a, const XMC_ERU_ETL_INPUT_B_t input_b)
 
void XMC_ERU_ETL_SetSource (XMC_ERU_t *const eru, const uint8_t channel, const XMC_ERU_ETL_SOURCE_t source)
 
void XMC_ERU_ETL_SetEdgeDetection (XMC_ERU_t *const eru, const uint8_t channel, const XMC_ERU_ETL_EDGE_DETECTION_t edge_detection)
 
XMC_ERU_ETL_EDGE_DETECTION_t XMC_ERU_ETL_GetEdgeDetection (XMC_ERU_t *const eru, const uint8_t channel)
 
__STATIC_INLINE void XMC_ERU_ETL_SetStatusFlag (XMC_ERU_t *const eru, const uint8_t channel)
 
__STATIC_INLINE void XMC_ERU_ETL_ClearStatusFlag (XMC_ERU_t *const eru, const uint8_t channel)
 
__STATIC_INLINE uint32_t XMC_ERU_ETL_GetStatusFlag (XMC_ERU_t *const eru, const uint8_t channel)
 
void XMC_ERU_ETL_SetStatusFlagMode (XMC_ERU_t *const eru, const uint8_t channel, const XMC_ERU_ETL_STATUS_FLAG_MODE_t mode)
 
void XMC_ERU_ETL_EnableOutputTrigger (XMC_ERU_t *const eru, const uint8_t channel, const XMC_ERU_ETL_OUTPUT_TRIGGER_CHANNEL_t trigger)
 
void XMC_ERU_ETL_DisableOutputTrigger (XMC_ERU_t *const eru, const uint8_t channel)
 
void XMC_ERU_OGU_Init (XMC_ERU_t *const eru, const uint8_t channel, const XMC_ERU_OGU_CONFIG_t *const config)
 
void XMC_ERU_OGU_EnablePatternDetection (XMC_ERU_t *const eru, const uint8_t channel, const XMC_ERU_OGU_PATTERN_DETECTION_INPUT_t input)
 
void XMC_ERU_OGU_DisablePatternDetection (XMC_ERU_t *const eru, const uint8_t channel)
 
__STATIC_INLINE uint32_t XMC_ERU_OGU_GetPatternDetectionStatus (XMC_ERU_t *const eru, const uint8_t channel)
 
void XMC_ERU_OGU_EnablePeripheralTrigger (XMC_ERU_t *const eru, const uint8_t channel, const XMC_ERU_OGU_PERIPHERAL_TRIGGER_t peripheral_trigger)
 
void XMC_ERU_OGU_DisablePeripheralTrigger (XMC_ERU_t *const eru, const uint8_t channel)
 
void XMC_ERU_OGU_SetServiceRequestMode (XMC_ERU_t *const eru, const uint8_t channel, const XMC_ERU_OGU_SERVICE_REQUEST_t mode)
 

Detailed Description

Event Request Unit (ERU) driver for the XMC microcontroller family.

The Event Request Unit (ERU) is a versatile multiple input event detection and processing unit. The ERU module can be used to expand the P-to-P connections of the device: ports-to-peripherals, peripherals-to-peripherals and ports-to-ports. It also offers configurable logic, that allows the generation of triggers, pattern detection and real-time signal monitoring.

eru_overview.png

The driver is divided into two sections:

Event trigger logic (ERU_ETL):
This section of the LLD provides the configuration structure XMC_ERU_ETL_CONFIG_t and the initialization function XMC_ERU_ETL_Init().
It can be used to:
  1. Select one out of two inputs (A and B). For each of these two inputs, a vector of 4 possible signals is available. (XMC_ERU_ETL_SetSource())
  2. Logically combine the two input signals to a common trigger. (XMC_ERU_ETL_SetSource())
  3. Define the transition (edge selection, or by software) that leads to a trigger event and can also store this status. (XMC_ERU_ETL_SetEdgeDetection() and XMC_ERU_ETL_SetStatusFlag())
  4. Distribute the events and status flags to the output channels. (XMC_ERU_ETL_EnableOutputTrigger())
Output gating unit (ERU_OGU):
This section of the LLD provides the provides the configuration structure XMC_ERU_OGU_CONFIG_t and the initialization function XMC_ERU_ETL_OGU_Init(). It can be used to:
  1. Combine the trigger events and status information and gates the output depending on a gating signal. (XMC_ERU_OGU_EnablePatternDetection(), XMC_ERU_OGU_DisablePeripheralTrigger(), XMC_ERU_OGU_SetServiceRequestMode())

Typedef Documentation

◆ XMC_ERU_ETL_CONFIG_t

◆ XMC_ERU_ETL_EDGE_DETECTION_t

Defines trigger edge for the event generation by ETLx (Event Trigger Logic, x = [0 to 3]) unit, by getting the signal from ERSx(Event request source, x = [0 to 3]) unit.

◆ XMC_ERU_ETL_INPUT_A_t

Defines input signal for path A of ERSx(Event request source, x = [0 to 3]) unit.

eru_input_a.png
ETLx Input A selection

◆ XMC_ERU_ETL_INPUT_B_t

Defines input signal for path B of ERSx(Event request source, x = [0 to 3]) unit.

eru_input_b.png
ETLx Input B selection

◆ XMC_ERU_ETL_OUTPUT_TRIGGER_CHANNEL_t

Defines Output Channel of OGUy(Output gating unit y = [0 to 3]) to be mapped by the trigger pulse generated by ETLx(Event Trigger Logic, x = [0 to 3]) unit.

Note
Generation of output trigger pulse need to be enabled XMC_ERU_OGU_PERIPHERAL_TRIGGER_t
eru_connection_matrix.png
ERU_ETL ERU_OGU Connection matrix

◆ XMC_ERU_ETL_OUTPUT_TRIGGER_t

Defines generation of the trigger pulse by ETLx(Event Trigger Logic, x = [0 to 3]) unit. Use type XMC_ERU_ETL_OUTPUT_TRIGGER_t for this enum.

◆ XMC_ERU_ETL_SOURCE_t

Defines input path combination along with polarity for event generation by ERSx(Event request source) unit to ETLx(Event trigger logic),x = [0 to 3] unit.

eru_input_trigger.png
ETLx input trigger signal generation

◆ XMC_ERU_ETL_STATUS_FLAG_MODE_t

Defines status flag reset mode generated by ETLx(Event Trigger Logic, x = [0 to 3]) unit. Use type XMC_ERU_ETL_STATUS_FLAG_MODE_t for this enum.

◆ XMC_ERU_OGU_CONFIG_t

◆ XMC_ERU_OGU_PATTERN_DETECTION_INPUT_t

Defines the inputs for Pattern detection. The configured status flag signal from the ETLx(Event Trigger Logic, x = [0 to 3]) unit indicates the pattern to be detected.

◆ XMC_ERU_OGU_PATTERN_DETECTION_t

Defines pattern detection feature to be enabled or not in OGUy(Output gating unit, y = [0 to 3]).

◆ XMC_ERU_OGU_PERIPHERAL_TRIGGER_t

Defines peripheral trigger signal for event generation. Based on the selected peripheral for event generation, the trigger signal is mapped.

◆ XMC_ERU_OGU_SERVICE_REQUEST_t

Defines the gating scheme for service request generation. In later stage of the OGUy(Output gating unit, y = [0 to 3]) based on the gating scheme selected ERU_GOUTy(gated output signal) output is defined.

interrupt_gating_signal.png
Interrupt gating signal

Enumeration Type Documentation

◆ XMC_ERU_ETL_EDGE_DETECTION

Defines trigger edge for the event generation by ETLx (Event Trigger Logic, x = [0 to 3]) unit, by getting the signal from ERSx(Event request source, x = [0 to 3]) unit.

Enumerator
XMC_ERU_ETL_EDGE_DETECTION_DISABLED 

no event enabled

XMC_ERU_ETL_EDGE_DETECTION_RISING 

detection of rising edge generates the event

XMC_ERU_ETL_EDGE_DETECTION_FALLING 

detection of falling edge generates the event

XMC_ERU_ETL_EDGE_DETECTION_BOTH 

detection of either edges generates the event

Definition at line 184 of file xmc_eru.h.

◆ XMC_ERU_ETL_INPUT_A

Defines input signal for path A of ERSx(Event request source, x = [0 to 3]) unit.

eru_input_a.png
ETLx Input A selection
Enumerator
XMC_ERU_ETL_INPUT_A0 

input A0 is selected

XMC_ERU_ETL_INPUT_A1 

input A1 is selected

XMC_ERU_ETL_INPUT_A2 

input A2 is selected

XMC_ERU_ETL_INPUT_A3 

input A3 is selected

Definition at line 137 of file xmc_eru.h.

◆ XMC_ERU_ETL_INPUT_B

Defines input signal for path B of ERSx(Event request source, x = [0 to 3]) unit.

eru_input_b.png
ETLx Input B selection
Enumerator
XMC_ERU_ETL_INPUT_B0 

input B0 is selected

XMC_ERU_ETL_INPUT_B1 

input B1 is selected

XMC_ERU_ETL_INPUT_B2 

input B2 is selected

XMC_ERU_ETL_INPUT_B3 

input B3 is selected

Definition at line 149 of file xmc_eru.h.

◆ XMC_ERU_ETL_OUTPUT_TRIGGER

Defines generation of the trigger pulse by ETLx(Event Trigger Logic, x = [0 to 3]) unit. Use type XMC_ERU_ETL_OUTPUT_TRIGGER_t for this enum.

Enumerator
XMC_ERU_ETL_OUTPUT_TRIGGER_DISABLED 

trigger pulse generation disabled

XMC_ERU_ETL_OUTPUT_TRIGGER_ENABLED 

trigger pulse generation enabled

Definition at line 210 of file xmc_eru.h.

◆ XMC_ERU_ETL_OUTPUT_TRIGGER_CHANNEL

Defines Output Channel of OGUy(Output gating unit y = [0 to 3]) to be mapped by the trigger pulse generated by ETLx(Event Trigger Logic, x = [0 to 3]) unit.

Note
Generation of output trigger pulse need to be enabled XMC_ERU_OGU_PERIPHERAL_TRIGGER_t
eru_connection_matrix.png
ERU_ETL ERU_OGU Connection matrix
Enumerator
XMC_ERU_ETL_OUTPUT_TRIGGER_CHANNEL0 

Event from input ETLx triggers output OGU0

XMC_ERU_ETL_OUTPUT_TRIGGER_CHANNEL1 

Event from input ETLx triggers output OGU1

XMC_ERU_ETL_OUTPUT_TRIGGER_CHANNEL2 

Event from input ETLx triggers output OGU2

XMC_ERU_ETL_OUTPUT_TRIGGER_CHANNEL3 

Event from input ETLx triggers output OGU3

Definition at line 198 of file xmc_eru.h.

◆ XMC_ERU_ETL_SOURCE

Defines input path combination along with polarity for event generation by ERSx(Event request source) unit to ETLx(Event trigger logic),x = [0 to 3] unit.

eru_input_trigger.png
ETLx input trigger signal generation
Enumerator
XMC_ERU_ETL_SOURCE_A 

select (A) path as a event source

XMC_ERU_ETL_SOURCE_B 

select (B) path as a event source

XMC_ERU_ETL_SOURCE_A_OR_B 

select (A OR B) path as a event source

XMC_ERU_ETL_SOURCE_A_AND_B 

select (A AND B) path as a event source

XMC_ERU_ETL_SOURCE_NOT_A 

select (inverted A) path as a event source

XMC_ERU_ETL_SOURCE_NOT_A_OR_B 

select (inverted A OR B) path as a event source

XMC_ERU_ETL_SOURCE_NOT_A_AND_B 

select (inverted A AND B) path as a event source

XMC_ERU_ETL_SOURCE_NOT_B 

select (inverted B) path as a event source

XMC_ERU_ETL_SOURCE_A_OR_NOT_B 

select (A OR inverted B) path as a event source

XMC_ERU_ETL_SOURCE_A_AND_NOT_B 

select (A AND inverted B) path as a event source

XMC_ERU_ETL_SOURCE_NOT_A_OR_NOT_B 

select (inverted A OR inverted B) path as a event source

XMC_ERU_ETL_SOURCE_NOT_A_AND_NOT_B 

select (inverted A AND inverted B) path as a event source

Definition at line 162 of file xmc_eru.h.

◆ XMC_ERU_ETL_STATUS_FLAG_MODE

Defines status flag reset mode generated by ETLx(Event Trigger Logic, x = [0 to 3]) unit. Use type XMC_ERU_ETL_STATUS_FLAG_MODE_t for this enum.

Enumerator
XMC_ERU_ETL_STATUS_FLAG_MODE_SWCTRL 

Status flag is in sticky mode. Retain the same state until cleared by software. In case of pattern match this mode is used.

XMC_ERU_ETL_STATUS_FLAG_MODE_HWCTRL 

Status flag is in non-sticky mode. Automatically cleared by the opposite edge detection.
eg. if positive edge is selected as trigger event, for the negative edge event the status flag is cleared.

Definition at line 220 of file xmc_eru.h.

◆ XMC_ERU_OGU_PATTERN_DETECTION

Defines pattern detection feature to be enabled or not in OGUy(Output gating unit, y = [0 to 3]).

Enumerator
XMC_ERU_OGU_PATTERN_DETECTION_DISABLED 

Pattern match is disabled

XMC_ERU_OGU_PATTERN_DETECTION_ENABLED 

Pattern match is enabled, the selected status flags of ETLx(Event Trigger Logic, x = [0 to 3]) unit, are used in pattern detection.

Definition at line 235 of file xmc_eru.h.

◆ XMC_ERU_OGU_PATTERN_DETECTION_INPUT

Defines the inputs for Pattern detection. The configured status flag signal from the ETLx(Event Trigger Logic, x = [0 to 3]) unit indicates the pattern to be detected.

Enumerator
XMC_ERU_OGU_PATTERN_DETECTION_INPUT0 

Status flag ETL0, participating in pattern match

XMC_ERU_OGU_PATTERN_DETECTION_INPUT1 

Status flag ETL1, participating in pattern match

XMC_ERU_OGU_PATTERN_DETECTION_INPUT2 

Status flag ETL0, participating in pattern match

XMC_ERU_OGU_PATTERN_DETECTION_INPUT3 

Status flag ETL0, participating in pattern match

Definition at line 247 of file xmc_eru.h.

◆ XMC_ERU_OGU_PERIPHERAL_TRIGGER

Defines peripheral trigger signal for event generation. Based on the selected peripheral for event generation, the trigger signal is mapped.

Enumerator
XMC_ERU_OGU_PERIPHERAL_TRIGGER1 

OGUy1 signal is mapped for event generation

XMC_ERU_OGU_PERIPHERAL_TRIGGER2 

OGUy2 signal is mapped for event generation

XMC_ERU_OGU_PERIPHERAL_TRIGGER3 

OGUy3 signal is mapped for event generation

Definition at line 259 of file xmc_eru.h.

◆ XMC_ERU_OGU_SERVICE_REQUEST

Defines the gating scheme for service request generation. In later stage of the OGUy(Output gating unit, y = [0 to 3]) based on the gating scheme selected ERU_GOUTy(gated output signal) output is defined.

interrupt_gating_signal.png
Interrupt gating signal
Enumerator
XMC_ERU_OGU_SERVICE_REQUEST_DISABLED 

Service request blocked, ERUx_GOUTy = 0

XMC_ERU_OGU_SERVICE_REQUEST_ON_TRIGGER 

Service request generated enabled, ERUx_GOUTy = 1

XMC_ERU_OGU_SERVICE_REQUEST_ON_TRIGGER_AND_PATTERN_MATCH 

Service request generated on trigger event and input pattern match, ERUx_GOUTy = ~pattern matching result

XMC_ERU_OGU_SERVICE_REQUEST_ON_TRIGGER_AND_PATTERN_MISMATCH 

Service request generated on trigger event and input pattern mismatch, ERUx_GOUTy = pattern matching result

Definition at line 271 of file xmc_eru.h.

Function Documentation

◆ XMC_ERU_Disable()

void XMC_ERU_Disable ( XMC_ERU_t *const  eru)
Parameters
eruA constant pointer to XMC_ERU_t, pointing to the ERU base address
Returns
None
Description:
Note:
Related APIs:
XMC_ERU_Enable()

Definition at line 58 of file xmc1_eru.c.

◆ XMC_ERU_Enable()

void XMC_ERU_Enable ( XMC_ERU_t *const  eru)
Parameters
eruA constant pointer to XMC_ERU_t, pointing to the ERU base address
Returns
None
Description:
This API is called by XMC_ERU_ETL_Init() or XMC_ERU_OGU_Init() and therefore no need to call it explicitly during initialization sequence. Call this API to enable ERU1 module once again if the module is disabled by calling XMC_ERU_Disable(). For ERU0 module clock gating and reset features are not available.
Note:
Related APIs:
XMC_ERU_ETL_Init(), XMC_ERU_OGU_Init(), XMC_ERU_Disable().

Definition at line 53 of file xmc1_eru.c.

Referenced by XMC_ERU_ETL_Init(), and XMC_ERU_OGU_Init().

Here is the caller graph for this function:

◆ XMC_ERU_ETL_ClearStatusFlag()

__STATIC_INLINE void XMC_ERU_ETL_ClearStatusFlag ( XMC_ERU_t *const  eru,
const uint8_t  channel 
)
Parameters
eruA constant pointer to XMC_ERU_t, pointing to the ERU base address.
channelERU_ETLx(Event trigger logic unit) channel. Range : [0 to 3]
Returns
None
Description:
Set the status flag bit(FL) in EXICONx(x = [0 to 3]).
If auto clear of the status flag is not enabled by detection of the opposite edge of the event edge, this API clears the Flag. SO that next event is considered as new event.
Related APIs:
XMC_ERU_ETL_SetStatusFlag(), XMC_ERU_ETL_GetStatusFlag()

Definition at line 623 of file xmc_eru.h.

◆ XMC_ERU_ETL_DisableOutputTrigger()

void XMC_ERU_ETL_DisableOutputTrigger ( XMC_ERU_t *const  eru,
const uint8_t  channel 
)
Parameters
eruA constant pointer to XMC_ERU_t, pointing to the ERU base address.
channelERU_ETLx(Event trigger logic unit) channel. Range : [0 to 3].
Returns
None
Description:
Disables the trigger pulse generation by clearing the (PE) of the EXICONx(x = channel).
Typically this can used when only pattern match is being used for event generation.
Related APIs:
XMC_ERU_ETL_EnableOutputTrigger()

Definition at line 231 of file xmc_eru.c.

◆ XMC_ERU_ETL_EnableOutputTrigger()

void XMC_ERU_ETL_EnableOutputTrigger ( XMC_ERU_t *const  eru,
const uint8_t  channel,
const XMC_ERU_ETL_OUTPUT_TRIGGER_CHANNEL_t  trigger 
)
Parameters
eruA constant pointer to XMC_ERU_t, pointing to the ERU base address.
channelERU_ETLx(Event trigger logic unit) channel. Range : [0 to 3].
triggerOutput Channel of OGUy(Output gating unit y = [0 to 3]) to be mapped by the trigger pulse Refer XMC_ERU_ETL_OUTPUT_TRIGGER_CHANNEL_t for valid value.
Returns
None
Description:
Configure which Channel of OGUy(Output gating unit y = [0 to 3]) to be mapped by the trigger pulse generated by ETLx(Event Trigger Logic, x = channel) by setting (OCS and PE) bit fields.
The trigger pulse is generated for one clock pulse along with the flag status update. This is typically used to trigger the ISR for the external events. The configured OGUy(Output gating unit y = [0 to 3]), generates the event based on the trigger pulse.If output trigger pulse generation is disabled by XMC_ERU_ETL_DisableOutputTrigger(), XMC_ERU_ETL_EnableOutputTrigger() can called to reconfigure. These values are set during initialization in XMC_ERU_ETL_Init(). Call this to change the trigger edge, as needed later in the program.
Related APIs:
XMC_ERU_ETL_DisableOutputTrigger()

Definition at line 218 of file xmc_eru.c.

◆ XMC_ERU_ETL_GetEdgeDetection()

XMC_ERU_ETL_EDGE_DETECTION_t XMC_ERU_ETL_GetEdgeDetection ( XMC_ERU_t *const  eru,
const uint8_t  channel 
)
Parameters
eruA constant pointer to XMC_ERU_t, pointing to the ERU base address.
channelERU_ETLx(Event trigger logic unit) channel. Range : [0 to 3]
Returns
XMC_ERU_ETL_EDGE_DETECTION_t indicate which egde/s is configured for event generation
Description:
Return event trigger edge/s by reading (RE, FE) bits of EXICONx(x = [0 to 3]) register.
Rising edge, falling edge or either edges can be selected to generate the event. Call this to get the configured trigger edge.

Definition at line 197 of file xmc_eru.c.

◆ XMC_ERU_ETL_GetStatusFlag()

__STATIC_INLINE uint32_t XMC_ERU_ETL_GetStatusFlag ( XMC_ERU_t *const  eru,
const uint8_t  channel 
)
Parameters
eruA constant pointer to XMC_ERU_t, pointing to the ERU base address.
channelERU_ETLx(Event trigger logic unit) channel. Range : [0 to 3].
Returns
uint32_t Current state of the status flag bit(FL). Result is in 32-bit format.
Description:
Returns status flag state of channel.
The function can typically be used to clear the status flag using software, when auto clear is not enabled.
Related APIs:
XMC_ERU_ETL_SetStatusFlag(), XMC_ERU_ETL_ClearStatusFlag()

Definition at line 646 of file xmc_eru.h.

◆ XMC_ERU_ETL_Init()

void XMC_ERU_ETL_Init ( XMC_ERU_t *const  eru,
const uint8_t  channel,
const XMC_ERU_ETL_CONFIG_t *const  config 
)
Parameters
eruA constant pointer to XMC_ERU_t, pointing to the ERU base address
channelERU_ETLx(Event trigger logic unit) channel Range : [0 to 3]
configpointer to a constant ERU_ETLx configuration data structure. Refer data structure XMC_ERU_ETL_CONFIG_t for detail.
Returns
None

Description:
Initializes the selected ERU_ETLx channel with the config structure.

Invokes XMC_ERU_Enable() to enable eru module clock. Then configures

  • Input signal for path A and Path B,
  • Trigger pulse generation,
  • status flag clear mode,
  • Event Trigger edge,
  • Output Channel of OGUy(Output gating unit y = [0 to 3]) to be mapped by the trigger pulse,
  • input path combination along with polarity for event generation

.

Definition at line 127 of file xmc_eru.c.

Here is the call graph for this function:

◆ XMC_ERU_ETL_SetEdgeDetection()

void XMC_ERU_ETL_SetEdgeDetection ( XMC_ERU_t *const  eru,
const uint8_t  channel,
const XMC_ERU_ETL_EDGE_DETECTION_t  edge_detection 
)
Parameters
eruA constant pointer to XMC_ERU_t, pointing to the ERU base address.
channelERU_ETLx(Event trigger logic unit) channel. Range : [0 to 3]
edge_detectionevent trigger edge. Refer XMC_ERU_ETL_EDGE_DETECTION_t enum for valid values.
Returns
None
Description:
Configure event trigger edge/s by setting (RE, FE) bits of EXICONx(x = [0 to 3]) register.
Rising edge, falling edge or either edges can be selected to generate the event.These values are set during initialization in XMC_ERU_ETL_Init(). Call this to change the trigger edge, as needed later in the program.

Definition at line 185 of file xmc_eru.c.

◆ XMC_ERU_ETL_SetInput()

void XMC_ERU_ETL_SetInput ( XMC_ERU_t *const  eru,
const uint8_t  channel,
const XMC_ERU_ETL_INPUT_A_t  input_a,
const XMC_ERU_ETL_INPUT_B_t  input_b 
)
Parameters
eruA constant pointer to XMC_ERU_t, pointing to the ERU base address.
channelERU_ETLx(Event trigger logic unit) channel. Range : [0 to 3]
input_ainput signal for path A of ERSx(Event request source, x = [0 to 3]) unit.
Refer XMC_ERU_ETL_INPUT_A_t for valid value or xmc1_eru_map.h/xmc4_eru_map.h file where the mapping of
the input is done based on selected signal.
e.g: ERU0_ETL3_INPUTA_P2_7.
input_binput signal for path B of ERSx(Event request source, x = [0 to 3]) unit.
Refer XMC_ERU_ETL_INPUT_B_t for valid value or xmc1_eru_map.h/xmc4_eru_map.h file where the mapping of
the input is done based on selected signal.
e.g: ERU0_ETL0_INPUTB_P2_0.
Returns
None
Description:
Configures the event source for path A and path B in with selected input_a and input_b respectively.
These values are set during initialization in XMC_ERU_ETL_Init(). Call this to change the input, as needed later in the program. According to the ports/peripheral selected, the event source has to be changed.

Definition at line 157 of file xmc_eru.c.

◆ XMC_ERU_ETL_SetSource()

void XMC_ERU_ETL_SetSource ( XMC_ERU_t *const  eru,
const uint8_t  channel,
const XMC_ERU_ETL_SOURCE_t  source 
)
Parameters
eruA constant pointer to XMC_ERU_t, pointing to the ERU base address.
channelERU_ETLx(Event trigger logic unit) channel. Range : [0 to 3]
sourceinput path combination along with polarity for event generation by ERSx(Event request source) unit. Refer XMC_ERU_ETL_SOURCE_t enum for valid input values.
Returns
None
Description:
Select input path combination along with polarity for event generation by setting (SS, NA, NB) bits in ERSx(Event request source) unit
The signal ERSxO is generated from the selection and this is connected to ETLx(Event trigger logic, x = [0 to 3]) for further action. These values are set during initialization in XMC_ERU_ETL_Init(). Call this to change the source, as needed later in the program.

Definition at line 173 of file xmc_eru.c.

◆ XMC_ERU_ETL_SetStatusFlag()

__STATIC_INLINE void XMC_ERU_ETL_SetStatusFlag ( XMC_ERU_t *const  eru,
const uint8_t  channel 
)
Parameters
eruA constant pointer to XMC_ERU_t, pointing to the ERU base address.
channelERU_ETLx(Event trigger logic unit) channel. Range : [0 to 3]
Returns
None
Description:
Set the status flag bit(FL) in EXICONx(x = [0 to 3]).
The status flag indicates that the configured event has occurred. This status flag is used in Pattern match detection by OGUy(Output gating unit, y = [0 to 3]).
Related APIs:
XMC_ERU_ETL_ClearStatusFlag(), XMC_ERU_ETL_GetStatusFlag()

Definition at line 600 of file xmc_eru.h.

◆ XMC_ERU_ETL_SetStatusFlagMode()

void XMC_ERU_ETL_SetStatusFlagMode ( XMC_ERU_t *const  eru,
const uint8_t  channel,
const XMC_ERU_ETL_STATUS_FLAG_MODE_t  mode 
)
Parameters
eruA constant pointer to XMC_ERU_t, pointing to the ERU base address.
channelERU_ETLx(Event trigger logic unit) channel. Range : [0 to 3].
modeSet whether status flag has to be cleared by software or hardware. Refer XMC_ERU_ETL_STATUS_FLAG_MODE_t for valid value.
Returns
None
Description:
Set the mode for status flag mode by setting (LD) bit in EXICONx(x = channel) register.
If SWCTRL is selected, status flag has to be cleared by software. This is typically used for pattern match detection. If HWCTRL is selected, status flag is cleared by hardware. If Positive edge is selected as event edge, for negative edge status flag is cleared and vice versa.This is typically used for continuous event detection.These values are set during initialization in XMC_ERU_ETL_Init(). Call this to change the trigger edge, as needed later in the program.
Related APIs:
XMC_ERU_ETL_ClearStatusFlag(), XMC_ERU_ETL_GetStatusFlag()

Definition at line 205 of file xmc_eru.c.

◆ XMC_ERU_OGU_DisablePatternDetection()

void XMC_ERU_OGU_DisablePatternDetection ( XMC_ERU_t *const  eru,
const uint8_t  channel 
)
Parameters
eruA constant pointer to XMC_ERU_t, pointing to the ERU base address
channelERU_OGUy(Output gating unit) channel Range : [0 to 3]
Returns
None
Description:
Disable the pattern detection by clearing (GEEN) bit.
Typically XMC_ERU_OGU_DisablePatternDetection is used when events has to be generated peripheral triggers.
Related APIs:
XMC_ERU_OGU_EnablePatternDetection(), XMC_ERU_OGU_GetPatternDetectionStatus()

Definition at line 253 of file xmc_eru.c.

◆ XMC_ERU_OGU_DisablePeripheralTrigger()

void XMC_ERU_OGU_DisablePeripheralTrigger ( XMC_ERU_t *const  eru,
const uint8_t  channel 
)
Parameters
eruA constant pointer to XMC_ERU_t, pointing to the ERU base address
channelERU_OGUy(Output gating unit) channel Range : [0 to 3]
Returns
None
Description:
Disables event generation based on peripheral trigger by clearing (ISS) bit.
This is typically used when peripheral trigger is no longer need. After calling XMC_ERU_OGU_DisablePeripheralTrigger(), XMC_ERU_OGU_EnablePeripheralTrigger() has to be called to reconfigure the signals again.
Related APIs:
XMC_ERU_OGU_EnablePeripheralTrigger()

Definition at line 275 of file xmc_eru.c.

◆ XMC_ERU_OGU_EnablePatternDetection()

void XMC_ERU_OGU_EnablePatternDetection ( XMC_ERU_t *const  eru,
const uint8_t  channel,
const XMC_ERU_OGU_PATTERN_DETECTION_INPUT_t  input 
)
Parameters
eruA constant pointer to XMC_ERU_t, pointing to the ERU base address
channelERU_OGUy(Output gating unit) channel Range : [0 to 3]
inputERU_ETLx(x = [0 to 3]), for pattern match detection. Refer XMC_ERU_OGU_PATTERN_DETECTION_INPUT_t for valid values. Logical OR combination of the enum items can be passed as the input.
Returns
None
Description:
Configures ERU_ETLx(x = [0 to 3]) for pattern match detection by setting IPENx(x = [0 to 3]) and GEEN bits.
These bits are dedicated to each channel of the ERU_ETLx(x = [0 to 3]). These values are set during initialization in XMC_ERU_OGU_Init(). Call this to change the pattern, as needed later in the program.
Related APIs:
XMC_ERU_OGU_DisablePatternDetection(), XMC_ERU_OGU_GetPatternDetectionStatus()

Definition at line 240 of file xmc_eru.c.

◆ XMC_ERU_OGU_EnablePeripheralTrigger()

void XMC_ERU_OGU_EnablePeripheralTrigger ( XMC_ERU_t *const  eru,
const uint8_t  channel,
const XMC_ERU_OGU_PERIPHERAL_TRIGGER_t  peripheral_trigger 
)
Parameters
eruA constant pointer to XMC_ERU_t, pointing to the ERU base address
channelERU_OGUy(Output gating unit) channel Range : [0 to 3]
peripheral_triggerwhich peripheral trigger signal is used for event generation. Refer XMC_ERU_OGU_PERIPHERAL_TRIGGER_t for the valid values, or xmc1_eru_map.h/xmc4_eru_map.h file where the mapping of the peripheral input is done based on input. e.g: ERU0_OGU0_PERIPHERAL_TRIGGER_CCU40_SR0.
Returns
None
Description:
Configures peripheral trigger input, by setting (ISS) bit.
Based on the peripheral the input signal has to be selected. These values are set during initialization in XMC_ERU_OGU_Init(). Call this to change the input, as needed later in the program.
Related APIs:
XMC_ERU_OGU_DisablePeripheralTrigger()

Definition at line 262 of file xmc_eru.c.

◆ XMC_ERU_OGU_GetPatternDetectionStatus()

__STATIC_INLINE uint32_t XMC_ERU_OGU_GetPatternDetectionStatus ( XMC_ERU_t *const  eru,
const uint8_t  channel 
)
Parameters
eruA constant pointer to XMC_ERU_t, pointing to the ERU base address
channelERU_OGUy(Output gating unit) channel Range : [0 to 3]
Returns
uint32_t returns the pattern match result. Result is in 32-bit format.
Description:
This API returns the pattern match result by reading (PDR) bit.
Related APIs:
XMC_ERU_OGU_EnablePatternDetection(), XMC_ERU_OGU_DisablePatternDetection()

Definition at line 799 of file xmc_eru.h.

◆ XMC_ERU_OGU_Init()

void XMC_ERU_OGU_Init ( XMC_ERU_t *const  eru,
const uint8_t  channel,
const XMC_ERU_OGU_CONFIG_t *const  config 
)
Parameters
eruA constant pointer to XMC_ERU_t, pointing to the ERU base address
channelERU_OGUy(Output gating unit) channel Range : [0 to 3]
configpointer to constant ERU_OGUy configuration data structure. Refer data structure XMC_ERU_OGU_CONFIG_t for detail.
Returns
None

Description:
Initializes the selected ERU_OGUy channel with the config structure.

Invokes XMC_ERU_Enable() to enable eru module clock. Then configures

  • Pattern detection,
  • Peripheral trigger input,
  • Gating for service request generation

.

Definition at line 144 of file xmc_eru.c.

Here is the call graph for this function:

◆ XMC_ERU_OGU_SetServiceRequestMode()

void XMC_ERU_OGU_SetServiceRequestMode ( XMC_ERU_t *const  eru,
const uint8_t  channel,
const XMC_ERU_OGU_SERVICE_REQUEST_t  mode 
)
Parameters
eruA constant pointer to XMC_ERU_t, pointing to the ERU base address
channelERU_OGUy(Output gating unit) channel Range : [0 to 3]
modegating scheme for service request generation. Refer XMC_ERU_OGU_SERVICE_REQUEST_t for valid values.
Returns
None
Description:
Configures the gating scheme for service request generation by setting (GP) bit.
Typically this function is used to change the service request generation scheme. These values are set during initialization in XMC_ERU_OGU_Init(). Call this to change the gating mode, as needed later in the program.

Definition at line 285 of file xmc_eru.c.